package Java7_Concurrency_Cookbook.concurrent_collection_framework.concurrent_linked_deque;

import java.util.concurrent.ConcurrentLinkedDeque;

/**
 * @author lixiangke
 * @date 2017/11/23
 */
public class AddTask implements Runnable {
    ConcurrentLinkedDeque<String> list;

    public AddTask(ConcurrentLinkedDeque<String> list) {
        this.list = list;
    }

    @Override
    public void run() {
        String tName = Thread.currentThread().getName();
        for (int i = 0; i < 10000; i++) {
            list.add(tName + ": Element " + i);
        }
    }
}
